package com.zelix;

import java.io.*;
import java.util.HashSet;
import java.util.Hashtable;

class y5 extends q5 implements h5 {

    private ks o;
    private ws p;
    private static String z[];

    y5(kt kt1, int i, String s, jb jb1, qy qy1, qy qy2, PrintWriter printwriter)
            throws IOException {
        super(kt1, i, s, jb1, qy1);
        int l = 0;

        byte abyte0[];
        int k;

        abyte0 = new byte[super.m];
        jb1.read(abyte0);
        jb jb2 = jb.a(abyte0, false);
        if (super.m == 4) {
            int j = jb2.readUnsignedShort();
            k = jb2.readUnsignedShort();
            is is1 = a(j);
            if (is1 != null && (is1 instanceof ks)) {
                o = (ks) is1;
            } else {
                super.n = false;
                printwriter.println(i() + z[4] + z[0] + z[1] + j + (is1 == null ? "" : z[3] + is1.l()));
            }
            if (k > 0) {
                is is2 = a(k);
                if (is2 != null && (is2 instanceof ws)) {
                    p = (ws) is2;
                    qy2.b(p, this);
                } else {
                    super.n = false;
                    printwriter.println(i() + z[4] + z[0] + z[2] + k + (is2 == null ? "" : z[3] + is2.l()));
                }
            }
            if (!super.n) {
                super.j = abyte0;
            }
        } else {
            super.n = false;
            super.j = abyte0;
            printwriter.println(i() + z[4] + z[0] + z[5] + super.m);
        }
    }

    public String a() {
        if (super.n)
            return o.b();
        else
            return null;
    }

    void a(HashSet hashset) {
        if (super.n && o != null)
            hashset.add(o);
    }

    void b(Hashtable hashtable) {
        if (super.n && p != null)
            hashtable.put(p, this);
    }

    public ws a(ws ws1) {
        ws ws2 = p;
        p = ws1;
        return ws2;
    }

    protected void a(DataOutputStream dataoutputstream, Hashtable hashtable, nh nh)
            throws IOException, tb {
        super.a(dataoutputstream, hashtable, nh);
        if (super.n) {
            dataoutputstream.writeShort(o.j());
            if (p == null) {
                dataoutputstream.writeShort(0);
            } else {
                ws ws1 = (ws) hashtable.get(p);
                if (ws1 != null) {
                    dataoutputstream.writeShort(ws1.j());
                } else {
                    dataoutputstream.writeShort(p.j());
                }
            }
        } else
            dataoutputstream.write(super.j);
    }

    private static String z(char[] chs) {
        byte key = 0;
        for (int i = 0; i < chs.length; i++) {
            switch (i % 5) {
                case 0:
                    key = 0x11;
                    break;
                case 1:
                    key = 119;
                    break;
                case 2:
                    key = 52;
                    break;
                case 3:
                    key = 86;
                    break;
                case 4:
                    key = 96;
                    break;
            }
            chs[i] ^= key;
        }
        return new String(chs).intern();
    }

    static {
        String as[];
        as = new String[6];
        as[0] = z("X\031B7\fx\023\024\023\016r\033[%\t\177\020y3\024y\030Pv!e\003F?\002d\003Q".toCharArray());
        as[1] = z("1_u\177@+W]8\004t\017\t".toCharArray());
        as[2] = z("1_v\177@+W]8\004t\017\t".toCharArray());
        as[3] = z("1M\024\"\001vJ".toCharArray());
        as[4] = z("1M\024".toCharArray());
        as[5] = z("1_w\177@+WX3\016v\003\\k".toCharArray());

        z = as;
    }
}
